<?php
namespace app\model;

use think\Model;

class MemberUserModel extends Model {
    protected $table = 'member_user';

    // 关联VIP信息
    public function vip()
    {
        return $this->hasOne('VipUserModel', 'user_id', 'user_id');
    }

    // 关联实名认证
    public function auth()
    {
        return $this->hasOne('MemberUserAuthenticationModel', 'user_id', 'user_id');
    }

    // 在MemberUserModel中添加关联
    public function authUserMobilePhone()
    {
        return $this->hasOne(AuthUserMobilePhoneModel::class, 'user_id', 'id');
    }

    public function authUserStatus()
    {
        return $this->hasOne(AuthUserStatusModel::class, 'user_id', 'id');
    }

    public function authentications()
    {
        return $this->hasMany(MemberUserAuthenticationModel::class, 'user_id', 'id');
    }

    public function orders()
    {
        return $this->hasMany(GameOrderModel::class, 'user_id', 'id');
    }

    public function status()
    {
        return $this->hasOne(AuthUserStatusModel::class, 'user_id', 'user_id');
    }
    
}
